package com.ptu.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ptu.common.ResponseResult;
import com.ptu.domain.entity.question.BlankFill;
import com.ptu.mapper.BlankFillMapper;
import com.ptu.service.BlankFillService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author PTU
 * @since 2023-07-02
 */
@Service
public class
BlankFillServiceImpl extends ServiceImpl<BlankFillMapper, BlankFill> implements BlankFillService {
    @Autowired
    private BlankFillMapper blankFillMapper;
    @Override
    public ResponseResult insertBlankFill(BlankFill blankFill) {
      int result=blankFillMapper.insert(blankFill);
        if (result == 1) {
            return ResponseResult.success("插入成功");
        }
        else{
            return ResponseResult.fail("插入失败");
        }
    }

    @Override
    public ResponseResult updateBlankFill(BlankFill blankFill) {
        int result=blankFillMapper.updateById(blankFill);
        if (result == 1) {
            return ResponseResult.success("更新成功");
        }
        else{
            return ResponseResult.fail("更新失败");
        }
    }
}
